<template>
    
    <!-- 组件的模板 -->
    <div class="page add-member">
        <div class="select-tip bg-color">请选择除姓名、手机号以外需要填写的信息：</div>
        <div class="weui-cells weui-cells_checkbox">
            <template v-for="item in member_info_need"> 
                <label class="weui-cell weui-check__label" :for="`s${item.id}`">
                    <div class="weui-cell__hd">
                        <template v-if="item.name == '身份证号' && item.selected == 1 && item.not_be_off == 1">                            
                            <input type="checkbox" class="weui-check" name="checkbox1" 
                                :id="`s${item.id}`" 
                                v-model="item.selected" 
                                :value="item" 
                                :disabled="isIdentity"
                            >
                        </template>
                        <template v-else>                        
                            <input type="checkbox" class="weui-check" name="checkbox1"
                                :id="`s${item.id}`" 
                                v-model="item.selected" 
                                :value="item"
                            >
                        </template>
                       <!--  <input type="checkbox" class="weui-check" name="checkbox1" 
                            :id="`s${item.id}`" 
                            v-model="item.selected" 
                            :value="item"                            
                            checked="isIdentity" 
                            disabled="isIdentity" 
                        > -->
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p>{{item.name == "出生年月" ? '年龄' : item.name}}</p>
                    </div>
                </label>
            </template>
        </div>
    </div> 
</template>

<script>
    /**
     *  引入工具类库 或 Native API
     *  example : import widget from 'gapi/widget'
     */
    import commonPage from 'clientApi/commonPage.js'
    import * as util from 'js/util.js'
    import widget from 'gapi/widget'
    
    /**
     *  引入组件 以及 组件接口(Action)
     *  example : import Somecomponents from 'components/Somecomponents/Somecomponents'
     */

    /**
     *  组件实例对象
     */
    export default {
        components: {

        },
        data: function(){
            return{
                member_info_need: [],
                isIdentity:false,
            }
        },
        vuex: {
            getters: {

            },
            actions: {

            }
        },
        methods: {
            /**
             * 初始化
             * @method init
             * @public
             * @return {Null} void
             */
            init (){
                this.team_id = util.getUrddataString('team_id')
                this.project_id = util.getUrddataString('project_id')
                this.member_info_need = JSON.parse(util.getUrddataString('member_info_need'))
                console.log(JSON.stringify(this.member_info_need))
                this.member_info_need.forEach((i) => {
                    if(i.name == '身份证号' && i.selected == 1){
                        this.isIdentity = true
                    }
                })                
            },
            comit(){
                commonPage.goBack(1,{'key': 'member_info_need','member_info_need': this.member_info_need})
            }
        },
        created(){

            this.init();
            commonPage.updateTitleBar({
                rightDisplay: true,
                rightText: '完成',
                rightAction: 'comit'
            })
            window.comit = this.comit
        }
        
    }

    
</script>

<!-- CSS 样式 -->
<!-- <style src="static/css/global.css"></style> -->
<style src="../../node_modules/weui/dist/style/weui.css"></style>
<style src="../../static/css/common.css"></style>
<style src="../../static/css/project.css"></style>



